<template>
  <div class="container">
    <el-card class="card" style="width: 700px">
      <el-form ref="formRef" :model="form" :rules="rules" style="margin-top: 10px;">
        <div>
          <el-divider content-position="center">
            <span class="title">完善联系方式</span>
          </el-divider>

          <el-form-item prop="code">
            <el-input v-model="form.code" size="large" :prefix-icon="Iphone" placeholder="请输入验证码"
                      style="width: 180px;"/>
          </el-form-item>
        </div>
        <div>
          <el-divider content-position="center">
            <span class="title">完善单位信息</span>
          </el-divider>
        </div>
        <div style="text-align: center;">
          <el-button type="primary" @click="handleSubmit" :loading-icon="Eleme" :loading="loading">提交</el-button>
          <el-button @click="handleCancel">取消</el-button>
        </div>
      </el-form>


    </el-card>
  </div>
</template>

<script setup>
import {onMounted, reactive, ref} from 'vue'
import {Eleme, Iphone, Message} from '@element-plus/icons-vue'
import {ElMessage} from "element-plus"
import VerificationCodeDialog from './components/verification-code-dialog.vue'
import {useRouter} from 'vue-router'
import {getToken} from "@/utils/token-util.js";

const router = useRouter();

const formRef = ref(null);

const form = reactive({
  uuid: '',
  code: '',//验证码
  phoneNumber: ''//注册手机号
});


const rules = ref({
  code: [
    {
      required: true,
      message: '请输入验证码',
      trigger: 'blur'
    },
    {
      min: 4,
      max: 4,
      message: '请输入4位验证码',
      trigger: 'blur'
    }
  ]
});


const handleSubmit = () => {

}

const handleCancel = () => {

};


onMounted(() => {
  //如果还未登入
  if (!getToken()) {
    router.push('/company/login');
  }
});


</script>

<style scoped>
.container {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center; /* 水平居中 */
  align-items: center; /* 垂直居中 */

  .card {
    padding-left: 40px;
    padding-right: 40px;


    .title {
      font-size: 16px !important;
      font-weight: bold;
    }
  }
}
</style>